package com.qq.BFMRSE.Test;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.qq.BFMRSE.BussinessService.userBusSerImpl;
import com.qq.BFMRSE.Hdfs.hdfsOper;
import com.qq.BFMRSE.model.encryptedIndex;
import com.qq.BFMRSE.model.indexTree;
import com.qq.BFMRSE.model.indexTreeNode;
import com.qq.BFMRSE.util.BFConstants;
import com.qq.BFMRSE.util.objectSerializeUtil;
import com.qq.BFMRSE.util.paraseJsonUtil;

public class daoTest {
	public static void main(String []args){
		String userName="yuan";
		Map<String, encryptedIndex>  indexMap=hdfsOper.readEnIndex(userName+File.separator+BFConstants.SERINDEXNAME);
		indexTreeNode  root=hdfsOper.readIndexTree(userName+File.separator+BFConstants.SERTREENAME);
		indexTree tree=new indexTree(root);
		Set<String> keys=indexMap.keySet();
		Iterator<String>iterator=keys.iterator();
		while(iterator.hasNext()){
			System.out.println(iterator.next());
		}
		List<indexTreeNode> lists=tree.getAllLeafNode(root);
		System.out.println(lists.size());
		
		
	}

}
